
private function average(arr:Array):Number {
	return (sum(arr) / arr.length);
}

private function getHexFromRGB(r:uint, g:uint, b:uint):uint{
    var hex:uint = (r << 16 | g << 8 | b);
    return hex;
}

private function maxSignal():Number {
	var max:* = null;
	for (var name:String in tissueList) {
		if (max == null) {
			max = tissueList[name].signal;
		} else if (tissueList[name].signal > max) {
			max = tissueList[name].signal;
		}
	}
	return max;
}


private function roundNumber(num:Number, noPlaces:Number):Number {
    return Math.round(num * Math.pow(10, noPlaces)) / Math.pow(10, noPlaces);
}

private function sum(arr:Array):Number {
	var result:Number = 0;
	for (var i:int = 0; i < arr.length; i++) {
		result += arr[i];
	}
 	return result;
}

private function clamp(input:Number, min:Number, max:Number):Number{
	if (input > max) {
		return max
	}
	if (input < min) {
		return min
	}
	return input
}
